<div class="form" id="addressDialogForm">
 
<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'address-form',
    'enableAjaxValidation'=>true,
)); 
//I have enableAjaxValidation set to true so i can validate on the fly the
?>
 
    <p class="note">Fields with <span class="required">*</span> are required.</p>
 
    <?php echo $form->errorSummary($model); ?>
 
	<div class="row">
		<?php echo $form->labelEx($model,'houseNumber'); ?>
		<?php echo $form->textField($model,'houseNumber',array('size'=>10,'maxlength'=>10)); ?>
		<?php echo $form->error($model,'houseNumber'); ?>
	</div>

	<div class="column">
		<?php echo $form->labelEx($model,'streetName'); ?>
		<?php echo $form->textField($model,'streetName',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'streetName'); ?>
	</div>

	<div class="column">
		<?php echo $form->labelEx($model,'addressLine1'); ?>
		<?php echo $form->textField($model,'addressLine1',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'addressLine1'); ?>
	</div>

	<div class="column">
		<?php echo $form->labelEx($model,'locality'); ?>
		<?php echo $form->textField($model,'locality',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'locality'); ?>
	</div>

	<div class="column">
		<?php echo $form->labelEx($model,'city'); ?>
		<?php echo $form->textField($model,'city',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'city'); ?>
	</div>

	<div class="column">
		<?php echo $form->labelEx($model,'postCode'); ?>
		<?php echo $form->textField($model,'postCode',array('size'=>6,'maxlength'=>6)); ?>
		<?php echo $form->error($model,'postCode'); ?>
	</div>

	<div class="column">
		<?php echo $form->labelEx($model,'country'); ?>
		<?php echo $form->dropDownList($model, 'country',  
              array('IND' => 'India', 'SL' => 'Srilanka', 'UAE' => 'United Arab Emirates', 'SAUDI' => 'Saudi Arabia', 'OMAN' => 'Oman'),
              array('empty' => 'Select a Country')); ?>	
  		<?php echo $form->error($model,'country'); ?>
	</div>

 
    <div class="row buttons">
        <?php echo CHtml::ajaxSubmitButton(Yii::t('Addresses','Create Address'),CHtml::normalizeUrl(array('addresses/addnew','render'=>false)),array('success'=>'js: function(data) {
                        $("#Hospital_hospitaladdressId").append(data);
                        $("#addressDialog").dialog("close");
                    }'),array('id'=>'closeJobDialog')); ?>
    </div>
 
<?php $this->endWidget(); ?>
 
</div>